//
//  CHTradeBundle.m
//  CHTrade
//
//  Created by dun on 2022/4/2.
//

#import "CHTradeBundle.h"

@implementation CHTradeBundle

+(NSBundle *)currentResourceBundle{
    NSString *bundleName = @"CHTrade";
    NSURL *currentBundleURL = [[NSBundle mainBundle] URLForResource:bundleName withExtension:@"bundle"];
    NSBundle *currentBundle= [NSBundle bundleWithURL:currentBundleURL];
    return currentBundle;
}

+ (UIImage *)imageNamed:(NSString *)name{
    if (@available(iOS 13.0, *)) {
        return  [UIImage imageNamed:name inBundle:[self currentResourceBundle] compatibleWithTraitCollection:[UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]];
    }
    return [UIImage imageNamed:name inBundle:[self currentResourceBundle] compatibleWithTraitCollection:nil];
}

@end
